class XiaoShuo:
    def __init__(self, encoding) -> None:
        self.__name = ''
        self.__jianjie = ''
        self.__zuozhe = ''
        self.__url = ''
        self.__encoding = encoding
        self.zhangjie_list = []

class ZhangJie_L:
    def __init__(self, title_str, content_list, charset='utf-8') -> None:
        self.__title = title_str
        self.__content = self.__jiexi(content_list)
        self.__charset = charset
        self.__html = self.__generate_html()
    def __jiexi(self, content_list):
        content = ''
        for tmp_str in content_list:
            tmp_str = '<p>%s</p>\n' % tmp_str
            content = content + tmp_str
        return content
    def __generate_html(self):
        tmp_html = f"""  
        <!DOCTYPE html>  
        <html lang="zh">
        <head>
            <meta charset="{self.__charset}">  
            <meta name="viewport" content="width=device-width, initial-scale=1.0">  
            <title>{self.__title}</title>  
        </head>  
        <body>  
            <h3>{self.__title}</h3>  
            {self.__content}
        </body>  
        </html>  
        """  
        return tmp_html
    @property
    def title(self):
        return self.__title
    @property
    def content(self):
        return self.__content
    @property
    def html(self):
        return self.__html

def wirte_load_file(content, encoding, file_name):
    with open(file_name, 'w', encoding=encoding) as f:
        f.write(content.decode(encoding))